IHG.SelectionController.model = 'IE';
IHG.SelectionController.prototype.selection = function() // OK
{
	return this.txtarea.value.substring(this.start(), this.end());
}

IHG.SelectionController.prototype.start =function() // OK
{
	this.txtarea.focus(); // zeer belangrijk voor IE, aangezien hij het hele document afzoekt
	
	var range = document.selection.createRange();
	var storedRange = range.duplicate();
	
	storedRange.moveToElementText(this.txtarea);
	storedRange.setEndPoint('EndToEnd', range);
	
	return storedRange.text.length - range.text.length;
}

IHG.SelectionController.prototype.end = function() // OK
{
	this.txtarea.focus();
	
	var range = document.selection.createRange();
	var storedRange = range.duplicate();
	
	storedRange.moveToElementText(this.txtarea);
	storedRange.setEndPoint('EndToEnd', range);
	
	return storedRange.text.length;
}

IHG.SelectionController.prototype.move = function(start, end) // OK
{	
	var startNewLineCompensation = this.txtarea.value.substring(0, start).split('\r').length - 1;
	var endNewLineCompensation = this.txtarea.value.substring(start, end).split('\r').length - 1;
	if(typeof end != "number") end = start;

	var range = this.txtarea.createTextRange();

	range.collapse(true);
	range.moveStart("character", start - startNewLineCompensation);
	range.moveEnd("character", end - start - endNewLineCompensation);

	range.select();
}